#include "input.h"


SDLKey input_class::get_key(void){
	return event.key.keysym.sym;
}

Uint8 input_class::get_mouse_button(void){
	return event.button.button;
}

Uint8 input_class::get_event_type(void){
	return event.type;
}

Uint8 input_class::get_key_state(void){
	return event.key.state;
}

void input_class::update(std::list<event_class>* events_list){
	events_list->clear();
	while(SDL_PollEvent(&event)){
		event_class *event_new = new event_class( get_key(),get_mouse_button(),get_event_type(), get_key_state() );
		events_list->push_back(*event_new);
		delete event_new;
	}
}


event_class::event_class(SDLKey _key,Uint8 _button, Uint8 _type, Uint8 _key_state){
	key = _key;
	button = _button;
	type = _type;
	key_state = _key_state;
}

		
